package io.renren.modules.eas.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.eas.dao.EasBasicTeacherandclazzDao;
import io.renren.modules.eas.entity.EasBasicTeacherandclazzEntity;
import io.renren.modules.eas.service.EasBasicTeacherandclazzService;


@Service("easBasicTeacherandclazzService")
public class EasBasicTeacherandclazzServiceImpl extends ServiceImpl<EasBasicTeacherandclazzDao, EasBasicTeacherandclazzEntity> implements EasBasicTeacherandclazzService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<EasBasicTeacherandclazzEntity> page = this.page(
                new Query<EasBasicTeacherandclazzEntity>().getPage(params),
                new QueryWrapper<EasBasicTeacherandclazzEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public PageUtils searchPage(Map<String, Object> params, Long search) {
        IPage<EasBasicTeacherandclazzEntity> page = this.page(
                new Query<EasBasicTeacherandclazzEntity>().getPage(params),
                new QueryWrapper<EasBasicTeacherandclazzEntity>().eq(" teacher_id", search)
        );

        return new PageUtils(page);
    }

}